﻿//===========================================================
//==     2011 www.21ce.cc by WaveFingerCMS              ==
//==             www.21ce.cc                      ==
//==                                 ==
//===========================================================
using System;
using System.Data;
using System.IO;
using System.Collections.Generic;
using System.Text;
using WFinger.Model;
using WFinger.DALFactory;

namespace WFinger.CMS
{
	public class NewsJS
	{
		private INewsJS dal;
		public NewsJS()
		{
			dal = DataAccess.CreateNewsJS();
		}
		public IList<NewsJSInfo> GetPage(int PageIndex, int PageSize, out int RecordCount, out int PageCount, int JsType)
		{
			return dal.GetPage(PageIndex, PageSize, out RecordCount, out PageCount, JsType);
		}
		public void Delete(string id)
		{
			dal.Delete(id);
		}
		public DataTable GetJSFilePage(int PageIndex, int PageSize, out int RecordCount, out int PageCount, int id)
		{
			return dal.GetJSFilePage(PageIndex, PageSize, out  RecordCount, out  PageCount, id);
		}
		public DataTable GetJSFiles(string jsid)
		{
			return dal.GetJSFiles(jsid);
		}
		/// <summary>
		/// 获取JS调用新闻条数
		/// </summary>
		/// <param name="jsid">js编号</param>
		/// <returns>查询结果</returns>
		public DataTable GetJSNum(string jsid)
		{
			return dal.GetJSNum(jsid);
		}
		public void RemoveNews(int id)
		{
			dal.RemoveNews(id);
		}
		public NewsJSInfo GetSingle(int id)
		{
			return dal.GetSingle(id);
		}
		public NewsJSInfo GetSingle(string JsID)
		{
			return dal.GetSingle(JsID);
		}
		public void Update(NewsJSInfo info)
		{
			dal.Update(info);
		}
		public void Add(NewsJSInfo info)
		{
			info.JsID = dal.Add(info);
		}
		public string GetJsTmpContent(string jstmpid)
		{
			return dal.GetJsTmpContent(jstmpid);
		}
	}
}
